<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>

</head>
<body>
<div id="content"></div>
<script src="index.js"></script>
<script>
//    var currySingle = fn => ((limit) => judgeCurry = (...args) => args.length >= limit ? fn.apply(null, args) : (...args2) => judgeCurry.apply(null, args.concat(args2)))(fn.length)

    var currySingle = function(fn) {
        var limit = fn.length
        return function judgeCurry (...args) {
            if (args.length >= limit) {
                return fn.apply(null, args)
            } else {
                return function(...args2) {
                    return judgeCurry.apply(null, args.concat(args2))
                }
            }
        }
    }
    function add(x, y) {
        return (x + y);
    }
    var curryAdd = currySingle(add)
    var add2 = curryAdd(2)
    var result = add2(3);
    console.info(result)

</script>
</body>
</html>
